package com.buer.storage.api;

import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ProjectName: zh_support_api
 * @Package: com.buer.storage.api.commom
 * @ClassName: CommonController
 * @Description: java类作用描述
 * @Author: lds
 * @CreateDate: 2019/4/11 0011 18:33
 * @UpdateUser: 更新者
 * @UpdateDate: 2019/4/11 0011 18:33
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
@RestController
@Api("通用接口")
public class CommonController {

 /*   @Autowired
    private FastdfsClientUtil fastdfsClientUtil;


    @RequestMapping("/upload")
    @ApiOperation("文件上传")
    public BaseResult upload (@RequestParam("fileData") MultipartFile file) throws Exception {
        String str = fastdfsClientUtil.upload(file);
        Map params = new HashMap();
        params.put("url", str);
        return BaseResult.build(ResultEnum.SUCCESS,params);
    }

    @ApiOperation(value = "上传图片")
    @RequestMapping(value = "/uploadByBase64", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public BaseResult uploadByBase64 (@RequestBody JSONObject jsonParam) throws Exception {
        String data=jsonParam.getString("data");
        String fileName=jsonParam.getString("fileName");
        MultipartFile multipartFile = MultipartFileUtils.base64toMultipart(data, fileName);
        String str= fastdfsClientUtil.upload(multipartFile);
        Map<String,Object> params =new HashMap<>(1);
        params.put("url", str);
        return BaseResult.build(ResultEnum.SUCCESS,params);
    }*/
}
